This disclosure relates to the field of computer systems and data storage. More particularly, a system, method, and apparatus are provided for formatting sequentially stored variable-length data in a manner that facilitates reverse reading of the data.
Variable-length data are stored in many types of applications and computing environments. For example, events that occur on a computer system, perhaps during execution of a particular application, are often logged and stored sequentially (e.g., according to timestamps indicating when they occurred) in log files, log-structured databases, or other repositories. Because different information is typically recorded for different events (e.g., different system metrics or application metrics), the records often have varying lengths.
When reading the recorded data in the same order it was written, it is relatively easy to quickly navigate the data and proceed from one record to the next, to find a requested record or for some other purpose. However, when attempting to scan the data in reverse order (e.g., to find the most recent record of a particular type or containing particular information), the task is more difficult because the storage schemes typically are not designed to enhance reverse navigation or scanning.